﻿@using Sausage.Common
@using Sausage.Web.Models
@using Telerik.Web.Mvc.UI
@{
    ViewBag.Title = "图";
    Layout = "~/Views/Shared/MainLayout.cshtml";
}

@section HeadCssLink
{
    @Html.Telerik().StyleSheetRegistrar().DefaultGroup(group => group.Add("telerik.common.css").Add("telerik.rtl.css").Combined(false).Compress(false))
}
@section HeadScriptLink
{
    @Html.Telerik().ScriptRegistrar().DefaultGroup(group => group.Add("telerik.common.js").Add("telerik.draganddrop.js").Add("telerik.window.js").Add("telerik.chart.js")).jQuery(false)
}
<div>
    @{
        Html.Telerik().Chart<PieTargetSource>()
            .Name("PieChart")
            .Title( title=>title.Text("XXXX 工程 工料机 使用情况").Font("normal bold 18px arial,sans-serif;"))
            .Series(series =>
                        {
                            series.Pie("Percentage", "Source")
                                .Labels(labels => labels.Visible(true).Template("<#= value #>%")
                                                      .Align(ChartPieLabelsAlign.Column)
                                                      .Position(ChartPieLabelsPosition.OutsideEnd))
                                .StartAngle(90).Padding(60);
                        })
            .DataBinding(dataBinding => dataBinding.Ajax().Select("SpainPieChart", "Chart")
            )
            .Legend(legend => legend.Position(ChartLegendPosition.Custom).Offset(300,50))
            .Tooltip(tooltip => tooltip.Visible(true).Template("<#= value #>%"))
            .HtmlAttributes(new {style = "width: 500px; height: 400px;"}).Render();
    }

    @Html.Telerik().ScriptRegistrar().jQuery(false).jQueryValidation(false)
</div>